package com.baizhi.thread;

/**
 * 实现Runable接口的方式，的匿名内部类写法
 */
public class ThreadDemo4 {
    public static void main(String[] args) {
        Runnable r1 = new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 10000; i++) {
                    System.out.println("大家好，");
                }
            }
        };


        Runnable r2 = new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 10000; i++) {
                    System.out.println("才是真的好");
                }
            }
        };

        new Thread(r1).start();
        new Thread(r2).start();
    }
}
